{% extends 'HelloWebUserBundle::layout.html.twig' %}



{% block layoutAlert %}
    {% include "::message.html.twig" %}
{% endblock %}

{% block layoutBody %}
<ol class="breadcrumb">
    <li><a href="{{ path('admin_user_index') }}"><span class=""></span> Administrator</a></li>
    <li class="active"><span class=""></span> Users</li>
</ol>
    
    <div class="row e-margin-top-20">
        <div class="col-md-8">
            <a class="btn btn-primary" href="{{ path('admin_user_add') }}">
                <span class=""></span>
                New
            </a>
        </div>
        <div class="col-md-4">
            
        </div>
    </div>

    <table class="table table-hover table-bordered e-margin-top-10">
        <thead>
        <tr>
            <th>Id</th>
            <th>First Name</th>
            <th>Last Name</th>
        </tr>
        </thead>
        <tbody>
        {% for user in usersPagination %}
            {% set url = path('admin_user_edit', {'id': user.id }) %}
                <tr class="e-clickable" data-url="{{ url }}">
                <td>
                    <a href="{{ url }}">
                        <span title="{{ user.firstName }}">{{ user.firstName }}</span>
                    </a>
                </td>
                <td>
                    <a href="{{ url }}">
                        <span title="{{ user.lastName }}">{{ user.lastName}}</span>
                    </a>
                </td>
                <td class="span4 text-right">
                    <a class="btn btn-primary" href="{{ path('admin_user_edit', {'id': user.id}) }}">
                        <span class="edit"></span>
                        Edit
                    </a>
                    <a class="btn btn-primary delete-action" href="{{ path('admin_user_edit', {'id': user.id}) }}">
                        <span class="delete"></span>
                        Delete
                    </a>
                </td>
            </tr>
        {% else %}
            <tr>
                <td colspan="2" class="text-center">
                    {# TODO: Translate me #}
                    There are no users to display.
                </td>
            </tr>
        {% endfor %}
        </tbody>
    </table>

    {{ knp_pagination_render(usersPagination) }}
{% endblock %}
{% block layoutFooter %}{% endblock %}
